import { defineStore } from 'pinia'
import $axios from '../tools/axios.js'

export const useDeptStore = defineStore('dept', {
  state: () => ({
    /** @type {{ text: string, id: number, isFinished: boolean }[]} */
    todos: [],
    /** @type {'all' | 'finished' | 'unfinished'} */
    filter: 'all',
    // type 会自动推断为 number
    nextId: 0
  }),
  getters: {},
  actions: {
    async findAll() {
      const path = '/p/q/findall'
      const { data: res } = await $axios.get(path)
      console.log(5678)
      console.log(res)
    }
  }
})
